/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package utilidades.dialog;

import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.layout.BorderPane;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
import javax.swing.event.HyperlinkEvent;

/**
 *
 * @author oscar
 */
public class OptionPane {
    
   public static final int ERROR_MESSAGE=0;
   public static final int SUCESS_MESSAGE=1;
   public static final int INFORMATION_MESSAGE=2;
   public static final int WARNING_MESSAGE=3;
   public static final int QUESTION_MESSAGE=4;
   public static final int PLAIN_MESSAGE=5; 
   
  /* 
   static final int DEFAULT_OPTION=0;
   static final int YES_NO_OPTION=1;
   static final int YES_NO_CANCEL_OPTION=2;
   static final int OK_CANCEL_OPTION=3;*/
   
   static int result;
   
 

    public static int showOptionDialog(String title,String message, String titleInterno, int messageType, String[] options) {
         
        final DialgoFXML panel=new DialgoFXML();
        panel.showOptionDialog(message, titleInterno, messageType, options);
        Scene escena=new Scene(panel);
        Stage ventana=new Stage();
        ventana.setResizable(false);
      ventana.addEventFilter(WindowEvent.WINDOW_HIDDEN, new  EventHandler(){
           

            @Override
            public void handle(Event t) {
                result=panel.getNroBotonSeleccionado();
                
            }
          
      });
        ventana.initModality(Modality.APPLICATION_MODAL);
        ventana.setTitle(title);
        ventana.setScene(escena);
        ventana.showAndWait();
       

        return result;
    }
}
